/*
* Copyright (c) 2016 . All Rights Reserved.
*/
package com.cgmnx.admin.web.controller;

import com.cgmnx.admin.biz.NoteBiz;
import com.cgmnx.admin.web.converter.vm.NoteVmConverter;
import com.cgmnx.admin.web.model.vm.NoteVm;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import javax.annotation.Resource;

/**
 * @author: created  Date: 16/12/25 Time: 下午2:41
 * @version: 1.0
 */
@RestController
public class NoteUiController extends BaseAdminController {

    @Resource
    private NoteBiz nodeBiz;

    @Resource
    private NoteVmConverter noteVmConverter;

    @RequestMapping("/note/query.html")
    public ModelAndView query(@RequestParam("id") Integer id) {

        ModelAndView modelAndView = new ModelAndView("/note/info");

//        final NoteEntity query = nodeBiz.query(id);
//
//        final NoteVm vm = noteVmConverter.convert(query);
        modelAndView.addObject("node", NoteVm.DEFAULT_INSTANCE);
        return modelAndView;
    }

    @RequestMapping("/note/publish.html")
    public ModelAndView publish(Model model) {

        ModelAndView modelAndView = new ModelAndView("/note/create");

        return modelAndView;
    }

}